 using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApplication1
{
    public class SweetCalculator
    {
        public double GetTotalWeight(Present present)
        {
            double totalWeight = 0;
            List<AbstractSweet> sweets = present.GetSweets();

            for (int i = 0; i < sweets.Count; i++)
            {
                totalWeight += sweets[i].Weight;
            }

            return totalWeight;
        }
    }
}
